/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.cemaden.library.model.smp;

import br.gov.cemaden.library.model.BaseEntity;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author Simone Santos
 */
@Entity
@Table(name = "smp_usuario", schema = "smp")
@SequenceGenerator(name = "sequence", sequenceName = "smp.usuario_sequence", schema = "smp")
@NamedQueries({
    @NamedQuery(name = "UsuarioSistema.findAll", query = "SELECT a FROM UsuarioSistema a ORDER BY a.id ASC"),
    @NamedQuery(name = "UsuarioSistema.findById", query = "SELECT a FROM UsuarioSistema a WHERE a.id = :id"),
    @NamedQuery(name = "UsuarioSistema.findByUser", query = "SELECT a FROM UsuarioSistema a WHERE a.user = :user"),})
public class UsuarioSistema implements Serializable, BaseEntity {

    @Id
    @GeneratedValue(generator = "sequence", strategy = GenerationType.AUTO)
    @Column(name = "id_usuario", nullable = false, unique = true)
    private Long id;
    
    @Column(name = "use", length = 100, nullable = true)
    private String user;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 89 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final UsuarioSistema other = (UsuarioSistema) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "UsuarioSistema{" + "id=" + id + ", user=" + user + '}';
    }
}
